<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include  file="../jsp/userControl.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 12;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
//跳转页面
function choosePage(courseId,intPageCount){
	//即将跳转页数
	var page = window.document.getElementById("page").value;
	if(page ==  "" || parseInt(page) < 1 || parseInt(page)> intPageCount){
		alert("输入的页数错误");
	}else{
		window.location.href= "informShow?courseId="+courseId+"&intPage="+page;
	}
	
}

	var  highlightcolor='#d5f4fe';
	//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
	var  clickcolor='#51b2f6';
	function  changeto(){
		source=event.srcElement;
		if  (source.tagName=="TR"||source.tagName=="TABLE")
			return;
		while(source.tagName!="TD")
			source=source.parentElement;
			source=source.parentElement;
			cs  =  source.children;
		//alert(cs.length);
		if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
		for(var i=0;i<cs.length;i++){
			cs[i].style.backgroundColor=highlightcolor;
		}
	}

	function  changeback(){
		if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
			return
		if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
			//source.style.backgroundColor=originalcolor
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor="";
		}
	}

	function  clickto(){
		source=event.srcElement;
		if  (source.tagName=="TR"||source.tagName=="TABLE")
			return;
		while(source.tagName!="TD")
		source=source.parentElement;
		source=source.parentElement;
		cs  =  source.children;
		//alert(cs.length);
		if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor=clickcolor;
			}
		else
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor="";
		}
}
</script>

</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<!-- 第一行 -->
			<tr>
				<td height="30">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td height="24" bgcolor="#353c44">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td>
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="6%" height="19">
														<div align="center">
															<img src="images/tb.gif" width="14" height="14" />
														</div>
													</td>
													<td width="15%" height="19"><span class="STYLE1">通知列表</span>
													</td>
													<td width="79%" height="19">
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>

			<!-- 第二行 -->
			<tr>
				<td><table width="100%" border="0" cellpadding="0"
						cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"
						onmouseout="changeback()">
						<tr>
							<td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">通知标题</span>
								</div></td>
							<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">通知内容</span>
								</div></td>
							<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">创建时间</span>
								</div></td>
							<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">创建者</span>
								</div></td>

						</tr>

						<s:iterator value="#request.userInformListBean.userInformList">
							<tr>
								<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div
										align="center">
										<span class="STYLE19"><s:property value="informBean.informHead" /></span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<s:property value="informBean.informBody" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<s:property value="informBean.creationTime" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<s:property value="userBean.username" />
									</div></td>
							</tr>
						</s:iterator>
					</table></td>
			</tr>

			<!-- 第三行 -->
			<tr>
				<td height="30"><table width="100%" border="0" cellspacing="0"
						cellpadding="0">
						<tr>
							<td width="33%"><div align="left">
									<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
											${request.pageInfoBean.intRowCount}</strong> 条记录，当前第<strong>
											${request.pageInfoBean.intPage}</strong> 页，共 <strong>${request.pageInfoBean.intPageCount}</strong>
										页
									</span>
								</div></td>
							<td width="67%">
								<table width="312" border="0" align="right" cellpadding="0"
									cellspacing="0">
									<tr>
										<!-- 首页 -->
										<td width="49">
											<div align="center">
												<a href="informShow?courseId=${request.courseId}&intPage==1"><img
													src="images/main_54.gif" width="40" height="15" /></a>
											</div>
										</td>

										<!-- 既没有“上一页”，也没有“下一页” -->
										<s:if test="#request.pageInfoBean.intPageCount == 1">
											<td width="49"><div align="center">
													<img src="images/main_56.gif" width="45" height="15" />
												</div></td>
											<td width="49"><div align="center">
													<img src="images/main_58.gif" width="45" height="15" />
												</div></td>
										</s:if>

										<!-- 只有“下一页” -->

										<s:elseif
											test="(#request.pageInfoBean.intPageCount > 1) && (#request.pageInfoBean.intPage == 1) ">
											<td width="49"><div align="center">
													<img src="images/main_56.gif" width="45" height="15" />
												</div></td>
											<td width="49"><div align="center">
													<a
														href="informShow?courseId=${request.courseId}&intPage=${request.pageInfoBean.intPage+1}"><img
														src="images/main_58.gif" width="45" height="15" /></a>
												</div></td>
										</s:elseif>

										<!-- 有“上一页”“下一页” -->
										<s:elseif
											test="(#request.pageInfoBean.intPage < #request.pageInfoBean.intPageCount) && (#request.pageInfoBean.intPage > 1) ">
											<td width="49"><div align="center">
													<a
														href="informShow?courseId=${request.courseId}&intPage=${request.pageInfoBean.intPage-1}"><img
														src="images/main_56.gif" width="45" height="15" /></a>
												</div></td>
											<td width="49"><div align="center">
													<a
														href="informShow?courseId=${request.courseId}&intPage=${request.pageInfoBean.intPage+1}"><img
														src="images/main_58.gif" width="45" height="15" /></a>
												</div></td>
										</s:elseif>

										<!-- 只有“上一页” -->

										<s:elseif
											test="(#request.pageInfoBean.intPage == #request.pageInfoBean.intPageCount) && (#request.pageInfoBean.intPage > 1)">
											<td width="49"><div align="center">
													<a
														href="informShow?courseId=${request.courseId}&intPage=${request.pageInfoBean.intPage-1}"><img
														src="images/main_56.gif" width="45" height="15" /></a>
												</div></td>
											<td width="49"><div align="center">
													<img src="images/main_58.gif" width="45" height="15" />
												</div></td>
										</s:elseif>

										<!-- 尾页 -->
										<td width="49"><div align="center">
												<a
													href="informShow?courseId=${request.courseId}&intPage=${request.pageInfoBean.intPageCount}"><img
													src="images/main_60.gif" width="40" height="15" /></a>
											</div></td>

										<!-- 转到？页 -->
										<td width="37" class="STYLE22"><div align="center">转到</div></td>
										<td width="22"><div align="center">
												<input type="text" name="page" id="page"
													style="width:20px; height:15px; font-size:12px; border:solid 1px #7aaebd;" />
											</div></td>
										<td width="22" class="STYLE22"><div align="center">页</div></td>
										<td width="35"><img src="images/main_62.gif" width="26"
											height="15"
											onclick="choosePage('${request.courseId}','${request.pageInfoBean.intPageCount}')" /></td>
									</tr>
								</table>
							</td>
						</tr>
					</table></td>
			</tr>
		</table>
</body>
</html>
